<template>
    <L7MapWithMapbox :mapOnloadCB="mapOnloadCB"></L7MapWithMapbox>
</template>

<script lang="ts">
import {Scene, Marker, Popup} from '@antv/l7';
import {defineComponent, onMounted, ref} from "vue"
import L7MapWithMapbox from "@/component/common/L7MapWithMapbox.component.vue"

export default defineComponent({
    name: "L7.addMark",
    components: {L7MapWithMapbox},
    setup() {
        const mapOnloadCB = (scene: Scene) => {

            const popup = new Popup({
                offsets: [0, 20]
            }).setText("this is a marker!");

            const marker = new Marker().setLnglat({lng: 106.558315, lat: 29.570494}).setPopup(popup);

            scene.addMarker(marker);
        }

        return {
            mapOnloadCB
        }
    }
})
</script>

<style scoped>

</style>
